<%-- 
    Document   : displayAllUsers
    Created on : Jun 24, 2011, 6:46:59 PM
    Author     : Bob
--%>
<%@include file="include_header.jsp"%>
<jsp:useBean id="userData" scope="application" class="edu.gatech.gellinservlet.model.UserManager" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>All Users - Lab Assistant Pro</title>
    </head>
    <body>
        <%@include file="pro_header.jsp" %>
        <%@include file="admin_list.jsp"%>

    <center>
        <h1>All Users:</h1>
        <table border="1">
            <thead>
                <tr>
                    <th>User Type:</th>
                    <th>Name:</th>
                    <th>Username:</th>
                    <th>ID:</th>
                </tr>
            </thead>
            <tbody>
                <% // print out all users in a table
                for (User u : userData.getDataList())
                    {
                        out.println("<tr><td>");
                        if (u instanceof Student)
                        {
                            out.println("Student");
                        } else if (u instanceof Instructor)
                        {
                            out.println("Instructor");
                        } else
                        {
                            out.println("Administrator");
                        }
                        out.println("</td><td>");
                        out.println(u.getName());
                        out.println("</td><td>");
                        out.println(u.getUsername());
                        out.println("</td><td>");
                        out.println(u.getID());
                        out.println("</td></tr>");
                    }%>
            </tbody>
        </table>
    </center>
    <% } //ends user_redirect else statement, html is included here %>
    <% } //ends verifySession.jsp, all html is included in else statment %>
    </body>
</html>
